import dayjs from "dayjs";

export class LogLogin {
    deatetime = undefined;
    mobile = "";
    username = "";
    client_ip = "";
    client_ip_area = "";
    device_type = "";
}

export class ExportQueryObj {
    start_time: number | undefined = undefined;
    end_time: number | undefined = undefined;
    _timerangeType: "week" | "month" = "week";
    constructor() {
        this.start_time = dayjs().subtract(6, "day").valueOf();
        this.end_time = dayjs().valueOf();
    }
    set timerangeType(val: "week" | "month") {
        if (val == "week") {
            this.start_time = dayjs().subtract(6, "day").valueOf();
            this.end_time = dayjs().valueOf();
        } else {
            this.start_time = dayjs().subtract(29, "day").valueOf();
            this.end_time = dayjs().valueOf();
        }
        this._timerangeType = val;
    }
    get timerangeType() {
        return this._timerangeType;
    }
    device_type = "";
}
